package mBeanControl.client;

import mBeanControl.connection.ConnectionFactory;
import mBeanControl.exceptions.ObjectNotFoundException;
import mBeanControl.interfaces.IDomain;
import mBeanControl.interfaces.IJMSDestination;
import mBeanControl.interfaces.IJMSServer;
import mBeanControl.interfaces.IServer;

public class TestQueue {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String hostname = "localhost";
		String portString = "7001";
		String username = "weblogic";
		String password = "weblogic";
		
		IDomain dr = ConnectionFactory.Connect(hostname, portString, username, password);
		
		IServer server;
		try {
			server = dr.getIServer("AdminServer");
		} catch (ObjectNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return;
		}
		
		System.out.println(server.getName());
		IJMSServer jMSServer = server.getIJMServer("LocalJMSServer");
		System.out.println(jMSServer.getName());
		IJMSDestination dest = jMSServer.getIJDestination("SystemModule-0!LocalQueue");
		System.out.println(dest.getMessagesHighCount());		
	}

}
